package com.bilubi.reggie.reggie.mapper;

import com.bilubi.reggie.reggie.annotation.AutoCleanRedis;
import com.bilubi.reggie.reggie.annotation.AutoFill;
import com.bilubi.reggie.reggie.bean.DishFlavor;
import com.bilubi.reggie.reggie.enums.OperateType;
import com.bilubi.reggie.reggie.enums.RedisDataType;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface DishFlavorMapper {
    @AutoCleanRedis(value = RedisDataType.DISH)
    int deleteByPrimaryKey(Long id);

    @AutoCleanRedis(value = RedisDataType.DISH)
    @AutoFill(value = OperateType.INSERT)
    int insert(List<DishFlavor> flavors);

    @AutoCleanRedis(value = RedisDataType.DISH)
    int deleteByDishId(Long dishId);

    List<DishFlavor> selectByDishId(Long id);

    @AutoCleanRedis(value = RedisDataType.DISH)
    int insertSelective(DishFlavor record);

    DishFlavor selectByPrimaryKey(Long id);

    @AutoCleanRedis(value = RedisDataType.DISH)
    int updateByPrimaryKeySelective(DishFlavor record);

    @AutoCleanRedis(value = RedisDataType.DISH)
    int updateByPrimaryKey(DishFlavor record);
}